Image Processing Method and Apparatus

ABSTRACT

Embodiments of the present invention disclose an image processing method and an apparatus. The image processing method includes: receiving information of starting a first camera and a second camera simultaneously to perform photographing; using the first camera to photograph and obtain a first image, and using the second camera to photograph and obtain a second image; and displaying the first image and the second image simultaneously. In the embodiments of the present invention, two cameras are started simultaneously to perform bidirectional photographing, and the images taken by both cameras are displayed simultaneously, so that front and back scene images are captured simultaneously and a panoramic image is obtained.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of International Application No.PCT/CN2013/080974, filed on Aug. 7, 2013, which claims priority toChinese Patent Application No. 201310004832.6, filed on Jan. 7, 2013,both of which are hereby incorporated by reference in their entireties.

STATEMENT REGARDING FEDERALLY SPONSORED RESEARCH OR DEVELOPMENT

Not applicable.

REFERENCE TO A MICROFICHE APPENDIX

Not applicable.

TECHNICAL FIELD

The present invention relates to the field of image processingtechnologies, and in particular, to an image processing method and anapparatus.

BACKGROUND

With popularization of photographing devices such as digital cameras anddigital video cameras, and integration of a photographing apparatus anda portable device, such as a mobile phone or PAD that has a built-incamera, people begin to use the photographing devices or the portabledevice to take images and record videos more and more frequently.

However, a photographing apparatus on a traditional photographing deviceor portable device can only perform separate foreground or backgroundphotographing, and can hardly capture and display both front and backscenes simultaneously.

In the prior art, fast switching can be performed between a front cameraand a rear camera on the device, and photographing of the front and backscenes can be implemented with timely switching, so that front-and-back180-degree scenes can be captured quickly. However, this method stillcannot implement simultaneous capturing of front and back scene images.

SUMMARY

Embodiments of the present invention provide an image processing methodand an apparatus, which can implement simultaneous capturing of frontand back scene images.

To solve the above technical problem, the embodiments of the presentinvention disclose the following technical solutions:

In a first aspect, an image processing method is provided, where themethod includes: receiving information of starting a first camera and asecond camera simultaneously to perform photographing; using the firstcamera to photograph and obtain a first image, and using the secondcamera to photograph and obtain a second image; and displaying the firstimage and the second image simultaneously.

With reference to the first aspect, in a first possible implementationmanner, the using the first camera to photograph and obtain a firstimage includes: obtaining a first focusing parameter of the firstcamera; and using the first camera to photograph according to the firstfocusing parameter to obtain the first image.

With reference to the first aspect and/or the first possibleimplementation manner, in a second possible implementation manner, theobtaining a first focusing parameter of the first camera includes: usingthe first camera to obtain a preview image of the first image; anddetermining the first focusing parameter of the first camera accordingto an operation of adjusting a focus for the preview image of the firstimage.

With reference to the first aspect and/or the first possibleimplementation manner and/or the second possible implementation manner,in a third possible implementation manner, the displaying the firstimage and the second image simultaneously includes: determining aspecified display area of the second image in the first image; anddisplaying the second image in the specified display area of the firstimage.

With reference to the first aspect and/or the first possibleimplementation manner and/or the second possible implementation mannerand/or the third possible implementation manner, in a fourth possibleimplementation manner, the determining a specified display area of thesecond image in the first image includes: determining a prominent areaand a non-prominent area in the first image according to a presetalgorithm; and using the non-prominent area in the first image as thespecified display area of the second image in the first image.

With reference to the first aspect and/or the first possibleimplementation manner and/or the second possible implementation mannerand/or the third possible implementation manner and/or the fourthpossible implementation manner, in a fifth possible implementationmanner, after the displaying the first image and the second imagesimultaneously, the method further includes: obtaining a drag locus ofthe second image; and determining a display position of the second imageaccording to the drag locus.

With reference to the first aspect and/or the first possibleimplementation manner and/or the second possible implementation mannerand/or the third possible implementation manner and/or the fourthpossible implementation manner and/or the fifth possible implementationmanner, in a sixth possible implementation manner, after the displayingthe first image and the second image simultaneously, the method furtherincludes: obtaining information about switching operations on displayareas of the first image and the second image; and exchanging thedisplay areas of the first image and the second image according to theinformation about the switching operations.

With reference to the first aspect and/or the first possibleimplementation manner and/or the second possible implementation mannerand/or the third possible implementation manner and/or the fourthpossible implementation manner and/or the fifth possible implementationmanner and/or the sixth possible implementation manner, in a seventhpossible implementation manner, after the displaying the first image andthe second image simultaneously, the method further includes: obtainingsimilarity between an edge area of the second image and a position thataccommodates the second image in the first image; and synthesizing thesecond image with the first image if the similarity is greater than orequal to a threshold.

With reference to the first aspect and/or the first possibleimplementation manner and/or the second possible implementation mannerand/or the third possible implementation manner and/or the fourthpossible implementation manner and/or the fifth possible implementationmanner and/or the sixth possible implementation manner and/or theseventh possible implementation manner, in an eighth possibleimplementation manner, the method further includes: adjusting the firstimage and/or the second image to increase the similarity if thesimilarity is smaller than the threshold.

In a second aspect, an image processing method is provided, where themethod is applied to a terminal that has a panoramic auxiliary lens andat least one camera, where the panoramic auxiliary lens is used toreflect or refract a surrounding view of the terminal to a photographingarea of the camera, and the method includes: receiving the viewreflected or refracted by the panoramic auxiliary lens; using the camerato photograph the view reflected or refracted by the panoramic auxiliarylens to obtain an image; and displaying the image obtained byphotographing.

With reference to the second aspect, in a first possible implementationmanner, the using the camera to photograph the view reflected orrefracted by the panoramic auxiliary lens to obtain an image includes:using the camera to obtain a preview image of the view reflected orrefracted by the panoramic auxiliary lens, where the preview imageincludes multiple preview sub-images from different angles; determininga focusing parameter of the camera according to an operation ofadjusting a focus for any preview sub-image of the multiple previewsub-images; and according to the focusing parameter, using the camera tophotograph the view reflected or refracted by the panoramic auxiliarylens to obtain an image.

With reference to the second aspect and/or the first possibleimplementation manner, in a second possible implementation manner, thedisplaying the image obtained by photographing includes: displaying theimage obtained by photographing continuously in a planar expansionmanner; or displaying the image obtained by photographing continuouslyin an annular display manner; or dividing the image obtained byphotographing into multiple images from different angles, and displayingthe multiple images from different angles simultaneously.

With reference to the second aspect and/or the first possibleimplementation manner and/or the second possible implementation manner,in a third possible implementation manner, after the displaying theimage obtained by photographing, the method further includes: croppingthe image obtained by photographing according to a set scale; and savingthe cropped image.

In a third aspect, an image processing apparatus is provided, where themethod includes: an information receiving unit configured to receiveinformation of starting a first camera and a second camerasimultaneously to perform photographing; an image obtaining unitconfigured to use the first camera to photograph and obtain a firstimage, and use the second camera to photograph and obtain a secondimage; and an image outputting unit configured to display the firstimage and the second image simultaneously.

With reference to the third aspect, in a first possible implementationmanner, the image obtaining unit includes: a parameter obtaining subunitconfigured to obtain a first focusing parameter of the first camera anda second focusing parameter of the second camera; and an image obtainingsubunit configured to use the first camera to photograph according tothe first focusing parameter to obtain the first image, and use thesecond camera to photograph according to the second focusing parameterto obtain the second image.

With reference to the third aspect and/or the first possibleimplementation manner, in a second possible implementation manner, theparameter obtaining subunit includes: a first subunit configured to usethe first camera to obtain a preview image of the first image; and asecond subunit configured to determine the first focusing parameter ofthe first camera according to an operation of adjusting a focus for thepreview image of the first image.

With reference to the third aspect and/or the first possibleimplementation manner and/or the second possible implementation manner,in a third possible implementation manner, the image outputting unitincludes: an area determining subunit configured to determine aspecified display area of the second image in the first image; and anoutputting subunit configured to display the second image in thespecified display area of the first image.

With reference to the third aspect and/or the first possibleimplementation manner and/or the second possible implementation mannerand/or the third possible implementation manner, in a fourth possibleimplementation manner, the area determining subunit includes: a thirdsubunit configured to determine a prominent area and a non-prominentarea in the first image according to a preset algorithm; and a fourthsubunit configured to use the non-prominent area in the first image asthe specified display area of the second image in the first image.

With reference to the third aspect and/or the first possibleimplementation manner and/or the second possible implementation mannerand/or the third possible implementation manner and/or the fourthpossible implementation manner, in a fifth possible implementationmanner, the apparatus further includes: a locus obtaining unitconfigured to obtain a drag locus of the second image; and a positiondetermining unit configured to determine a display position of thesecond image according to the drag locus.

With reference to the third aspect and/or the first possibleimplementation manner and/or the second possible implementation mannerand/or the third possible implementation manner and/or the fourthpossible implementation manner and/or the fifth possible implementationmanner, in a sixth possible implementation manner, the apparatus furtherincludes: an information obtaining unit configured to obtain informationabout switching operations on display areas of the first image and thesecond image; and a switching unit configured to exchange the displayareas of the first image and the second image according to theinformation about the switching operations.

With reference to the third aspect and/or the first possibleimplementation manner and/or the second possible implementation mannerand/or the third possible implementation manner and/or the fourthpossible implementation manner and/or the fifth possible implementationmanner and/or the sixth possible implementation manner, in a seventhpossible implementation manner, the apparatus further includes: acalculating unit configured to obtain similarity between an edge area ofthe second image and a position that accommodates the second image inthe first image; a synthesizing unit configured to synthesize the secondimage with the first image if the similarity is greater than or equal toa threshold; and an adjusting unit configured to adjust the first imageand/or the second image to increase the similarity if the similarity issmaller than the threshold.

In a fourth aspect, an image processing apparatus is provided, where theapparatus is applied to a terminal that has a panoramic auxiliary lensand at least one camera, where the panoramic auxiliary lens is used toreflect or refract a surrounding view of the terminal to a photographingarea of the camera, and the apparatus includes: a view receiving unitconfigured to receive the view reflected or refracted by the panoramicauxiliary lens; an image obtaining unit configured to use the camera tophotograph the view reflected or refracted by the panoramic auxiliarylens to obtain an image; and an image outputting unit configured todisplay the image obtained by photographing.

With reference to the fourth aspect, in a first possible implementationmanner, the image obtaining unit includes: a preview subunit configuredto use the camera to obtain a preview image of the view reflected orrefracted by the panoramic auxiliary lens, where the preview imageincludes multiple preview sub-images from different angles; a parameterdetermining subunit configured to determine a focusing parameter of thecamera according to an operation of adjusting the focus for any previewsub-image of the multiple preview sub-images; and an obtaining subunitconfigured to: according to the focusing parameter, use the camera tophotograph the view reflected or refracted by the panoramic auxiliarylens to obtain an image.

With reference to the fourth aspect and/or the first possibleimplementation manner, in a second possible implementation manner, theimage outputting unit is specifically configured to: display the imageobtained by photographing continuously in a planar expansion manner; ordisplay the image obtained by photographing continuously in an annulardisplay manner; or divide the image obtained by photographing intomultiple images from different angles, and display the multiple imagesfrom different angles simultaneously.

With reference to the fourth aspect and/or the first possibleimplementation manner and/or the second possible implementation manner,in a third possible implementation manner, the apparatus furtherincludes: a cropping unit configured to crop the image obtained byphotographing according to a set scale; and a saving unit configured tosave the cropped image.

In a fifth aspect, a terminal is provided, which includes a processor, adisplay, a memory, a first camera, and a second camera, where theprocessor is configured to control working states of the first cameraand the second camera, the processor is connected to the display and thememory respectively, the memory stores a set of program codes, and theprocessor is configured to call the program codes stored in the memoryto execute the following operations: receiving information of starting afirst camera and a second camera simultaneously to performphotographing; using the first camera to photograph and obtain a firstimage, and using the second camera to photograph and obtain a secondimage; and the display is configured to display the first image and thesecond image simultaneously.

In a sixth aspect, a terminal is provided, which includes a processor, adisplay, a memory, a panoramic auxiliary lens, and at least one camera,where the processor is configured to control a working state of thecamera, the panoramic auxiliary lens is configured to reflect or refracta surrounding view of the terminal to a photographing area of thecamera, the processor is connected to the display and the memoryrespectively, the memory stores a set of program codes, and theprocessor is configured to call the program codes stored in the memoryto execute the following operations: receiving the view reflected orrefracted by the panoramic auxiliary lens; and using the camera tophotograph the view reflected or refracted by the panoramic auxiliarylens to obtain an image; and the display is configured to display theimage obtained by photographing.

With reference to the sixth aspect, in a first possible implementationmanner, the panoramic auxiliary lens is located on top of the terminaland connected resiliently to the top of the terminal, and, whileworking, the panoramic auxiliary lens are in an pop-up state to reflector refract a surrounding view of the terminal to a photographing area ofthe camera.

In the embodiments of the present invention, two cameras are startedsimultaneously to perform bidirectional photographing, and the imagestaken by both cameras are displayed simultaneously, so that front andback scene images are captured simultaneously and a panoramic image isobtained.

BRIEF DESCRIPTION OF THE DRAWINGS

To describe the technical solutions in the embodiments of the presentinvention more clearly, the following briefly introduces theaccompanying drawings required for describing the embodiments. A personof ordinary skill in the art may still derive other drawings from theseaccompanying drawings without creative efforts.

FIG. 1 is a flowchart of an image processing method according to anembodiment of the present invention;

FIG. 2 is a flowchart of a method for obtaining a first image and asecond image according to an embodiment of the present invention;

FIG. 3 is a flowchart of a method for obtaining a focusing parameterinput by a user manually according to an embodiment of the presentinvention;

FIG. 4 is a flowchart of a method for displaying a first image and asecond image simultaneously according to an embodiment of the presentinvention;

FIG. 5 is a schematic diagram of spatial distribution in an embodimentshown in FIG. 4;

FIG. 6 is a schematic diagram of human face distribution in anembodiment shown in FIG. 4;

FIG. 7 is a schematic diagram of edge distribution in an embodimentshown in FIG. 4;

FIG. 8 is a flowchart of a method for determining a position of a secondimage according to an embodiment of the present invention;

FIG. 9 is a flowchart of a method for switching display areas of a firstimage and a second image according to an embodiment of the presentinvention;

FIG. 10 is a flowchart of a method for processing a first image and asecond image according to an embodiment of the present invention;

FIG. 11 is a flowchart of another image processing method according toan embodiment of the present invention;

FIG. 12 is a schematic structural diagram of a terminal in an embodimentshown in FIG. 11;

FIG. 13A is a schematic diagram of a first display mode of displaying apanoramic image according to an embodiment of the present invention;

FIG. 13B is a schematic diagram of a second display mode of displaying apanoramic image according to an embodiment of the present invention;

FIG. 14 is a schematic diagram of a third display mode of displaying apanoramic image according to an embodiment of the present invention;

FIG. 15 is a schematic diagram of processing a photographed non-planarimage according to an embodiment of the present invention;

FIG. 16 is a method flowchart of using a camera to photograph a viewreflected by a panoramic auxiliary lens to obtain an image according toan embodiment of the present invention;

FIG. 17A is a flowchart of a method for processing a image obtained byphotographing according to an embodiment of the present invention;

FIG. 17B is a schematic diagram of cropping an image obtained byphotographing in an embodiment shown in FIG. 17A;

FIG. 18 is a schematic structural diagram of an image processingapparatus according to an embodiment of the present invention;

FIG. 19 is a schematic structural diagram of an image obtaining unitaccording to an embodiment of the present invention;

FIG. 20 is a schematic structural diagram of an image inputting unitaccording to an embodiment of the present invention;

FIG. 21 is a schematic structural diagram of another image processingapparatus according to an embodiment of the present invention;

FIG. 22 is a schematic structural diagram of a terminal according to anembodiment of the present invention;

FIG. 23 is a schematic structural diagram of another terminal accordingto an embodiment of the present invention; and

FIG. 24 is a schematic structural diagram of a panoramic auxiliary lensaccording to an embodiment of the present invention.

DETAILED DESCRIPTION

To enable persons skilled in the art to better understand the technicalsolutions in the embodiments of the present invention and make the aboveobjectives, characteristics, and advantages of the present inventionmore comprehensible, the following describes the technical solutions ofthe present invention in more detail with reference to accompanyingdrawings.

Referring to FIG. 1, FIG. 1 is a flowchart of an image processing methodaccording to an embodiment of the present invention.

The method may include:

Step 101: Receive information of starting a first camera and a secondcamera simultaneously to perform photographing.

In this embodiment, a terminal, such as a mobile phone or PAD, includesat least a first camera and a second camera, where the first camera maybe either a front camera or a rear camera in a photographing apparatus,and the second camera may be the other of the front camera and the rearcamera; the front camera is a camera located on the same side as anoperation interface of the photographing apparatus, and the rear camerais a camera located on the rear side of the operation interface of thephotographing apparatus. Nevertheless, the first camera and the secondcamera may be cameras in other positions, and are only examples herein.

Depending on default settings, the terminal may start a bidirectionalphotographing function automatically when a user starts a photographingapplication, that is, the terminal receives information of starting thefirst camera and the second camera simultaneously to performphotographing; or, when the user starts the photographing application,the terminal displays a variety of option information to the user, forexample, the information of starting the first camera, starting thesecond camera, and starting bidirectional photographing, and the like.According to the user's operation of selecting the information ofstarting the bidirectional photographing, the terminal receives theinformation of starting the first camera and the second camerasimultaneously to perform photographing.

Step 102: Use the first camera to photograph and obtain a first image,and use the second camera to photograph and obtain a second image.

In the embodiment of the present invention, a control circuit of thefirst camera and a control circuit of the second camera may be inworking states simultaneously. An imaging system of the first camera mayalso be independent of an imaging system of the second camera, andtherefore, after receiving information of activating the first cameraand the second camera simultaneously, the terminal can use the firstcamera to photograph and obtain the first image and use the secondcamera to photograph and obtain the second image.

Step 103: Display the first image and the second image simultaneously.

After the terminal obtains the first image and the second imagesimultaneously, the first image and the second image may be displayed ona display screen simultaneously. Specifically, the display screen may bedivided into areas, a first image display area displays the first image,and a second image display area displays the second image; or, the firstimage is displayed in full screen, and the second image is displayed ina certain area of the first image at the same time, that is,picture-in-picture display is implemented. There are multiple displaymanners, which are not described here exhaustively.

In the embodiment of the present invention, two cameras are startedsimultaneously to perform bidirectional photographing, and images takenby both cameras are displayed simultaneously, so that front and backscene images are captured simultaneously and a panoramic image isobtained.

In another embodiment of the present invention, when a first camera isused to photograph and obtain a first image and a second camera is usedto photograph and obtain a second image, as shown in FIG. 2, the processmay include the following steps:

Step 201: Obtain a first focusing parameter of the first camera and asecond focusing parameter of the second camera.

Taking the first focusing parameter as an example, the first focusingparameter may be a focusing parameter obtained by the first camera in adefault automatic focusing manner; or may be a focusing parameter inputby the user manually and obtained by the terminal after the user inputsthe parameter manually or adjusts a focus manually. The second focusingparameter is similar to the first focus parameter, and details are notdescribed herein again.

As shown in FIG. 3, the manner of obtaining, by the terminal, a focusingparameter input by a user manually may include the following steps:

Step 301: Use the first camera to obtain a preview image of the firstimage, and use the second camera to obtain a preview image of the secondimage.

The preview image of the first image and the preview image of the secondimage may be displayed in separate areas simultaneously; or, the previewimage of the first image is displayed in full screen, and the previewimage of the second image is displayed in a certain area in the previewimage of the first image.

Step 302: Determine the first focusing parameter of the first cameraaccording to the user's operation of adjusting a focus for the previewimage of the first image, and determine the second focusing parameter ofthe second camera according to the user's operation of adjusting a focusfor the preview image of the second image.

The user may directly touch the screen to adjust the focus for thepreview image of the first image and the preview image of the secondimage respectively. When the preview image of the first image isdisplayed in full screen and the preview image of the second image isdisplayed in a certain area in the preview image of the first image, inorder to facilitate the user's operation of adjusting the focus for thepreview image of the second image, after the user adjusts the focus forthe preview image of the first image, the user may perform a slidingoperation on the display screen, and, after identifying the slidingoperation, the terminal exchanges the display mode of the preview imageof the first image with the display mode of the preview image of thesecond image, that is, displays the preview image of the second image infull screen and displays the preview image of the first image in acertain area in the preview image of the second image, and then theterminal determines a second focusing parameter of the second cameraaccording to the user's operation of adjusting the focus for the previewimage of the second image.

Step 202: Use the first camera to photograph and obtain a first imageaccording to the first focusing parameter, and use the second camera tophotograph and obtain a second image according to the second focusingparameter.

In another embodiment of the present invention, when the first image andthe second image are displayed simultaneously, one of the specificimplementation manners is: displaying the first image, and displayingthe second image in a specified display area of the first image. Asshown in FIG. 4, the displaying process may specifically include thefollowing steps:

Step 401: Determine a specified display area of the second image in thefirst image.

The process of determining the specified display area may specificallyinclude:

1) Determining a Prominent Area and a Non-Prominent Area in the FirstImage According to a Preset Algorithm.

The preset algorithm may be an existing algorithm, or a space-baseddistribution algorithm, or a human-face-based distribution algorithm, oran edge-based distribution algorithm, or the like. For example:

Manner 1: Space-Based Distribution Algorithm

First, a prominent area, a medium-level area, and a non-prominent areaof the first image are determined. If the first image is displayed infull screen, the prominent area, the medium-level area, and thenon-prominent area of the display screen may be determined. As shown inFIG. 5, the display area of the display screen may be divided into 3×3panes, the central area is a prominent area, the area outside thecentral area may be divided into a medium-level area and a non-prominentarea according to the extent of attracting attention of human eyes,where H represents a prominent area, M represents a medium-level area,and L represents a non-prominent area. The specified display area may bethe medium-level area or the non-prominent area. When being displayed,the second image may be displayed in the M area or the L area.

Manner 2: Human Face-Based Distribution Algorithm

First, a human face image of the user is obtained by using the camera,and then the area of the human face image is classified as a prominentarea (H), and the remaining area is classified as a non-prominent area(L), as shown in FIG. 6. The specified display area may be thenon-prominent area. If the first image is displayed in full screen, thesecond image may be located in the non-prominent area.

Manner 3: edge-based distribution algorithm

First, a prominent area (H) and an edge area (L) are determined based onthe edge-based distribution algorithm, as shown in FIG. 7. The specifieddisplay area may be the edge area. If the first image is displayed infull screen, the second image may be located in the edge area.

Manner 4: The specified display area may be preset. The size and theshape of the specified display area may be preset as required and mayalso be adjusted when displayed.

2) Using the Non-Prominent Area in the First Image as the SpecifiedDisplay Area of the Second Image in the First Image.

Step 402: Display the second image in the specified display area of thefirst image.

In another embodiment of the present invention, after the second imageis displayed in the specified display area of the first image, as shownin FIG. 8, the method may further include:

Step 801: Obtain a locus of the second image dragged by the user.

If the user needs to adjust a display position of the second image, theuser may tap the second image, and drag the second image in the displayscreen, and the terminal determines the drag operation information ofthe second image according to the tap and drag operations performed bythe user on the second image, and then can obtain the user's drag locusaccording to the position where the user's finger taps the screen.

Step 802: Determine a display position of the second image according tothe drag locus.

After determining the drag locus, the terminal may display the secondimage according to the drag locus.

In another embodiment of the present invention, after the second imageis displayed in the specified display area of the first image, as shownin FIG. 9, the method may further include the following steps:

Step 901: Obtain information about the user's switching operation on thedisplay areas of the first image and the second image.

The switching operation information may specifically be the user'ssliding operation between the first image and the second image, or theuser's continuous tap operation on the first image and the second image,or the like.

Step 902: Exchange the display areas of the first image and the secondimage according to the switching operation information.

After the exchange, the first image is displayed in the specifieddisplay area of the second image, and the second image may be displayedin full screen.

In another embodiment of the present invention, after the second imageis displayed in the specified display area of the first image, as shownin FIG. 10, the method may further include the following steps:

Step 1001: Obtain similarity between an edge area of the second imageand a position that accommodates the second image in the first image.

Specifically, characteristics such as color, edge, and texture in theedge area of the second image and those in the position thataccommodates the second image in the first image may be obtained, andthen the similarity between the characteristics is calculated.

Step 1002: Determine whether the similarity is greater than a threshold.

If the similarity is greater than the threshold, it indicates that thecolor and other characteristics at the edge of the second image areidentical or similar to those in the position that accommodates thesecond image in the first image, and, in this case, step 1003 isexecuted; and, if the similarity is smaller than the threshold, thefirst image and the second image may be saved directly, or step 1004 maybe executed.

Step 1003: Synthesize the second image with the first image.

This step may specifically be to adjust the hue, saturation, contrast,and brightness at the edge of the second image and in the position thataccommodates the second image in the first image, so as to decrease thedifference between the edge area of the second image and the firstimage, and then a display border of the second image is hidden orcancelled, and the second image and the first image are synthesized intoone image.

Step 1004: Adjust the first image and/or the second image to increasethe similarity between the edge area of the second image and theposition that accommodates the second image in the first image.

Specifically, one or more parameters such as color, hue, saturation,contrast, brightness, curve, and color level of the first image and/orthe second image may be adjusted to increase the similarity between theedge area of the second image and the position that accommodates thesecond image in the first image, so that the second image is displayedmore naturally with a consistent style in the first image.

Further, an embodiment of the present invention provides another imageprocessing method.

Referring to FIG. 11, FIG. 11 is a flowchart of the other imageprocessing method according to an embodiment of the present invention.

In the embodiment of the present invention, as shown in FIG. 12, theterminal has a panoramic auxiliary lens 121 and at least one camera 122.The panoramic auxiliary lens 121 may be an annular reflection orrefraction lens set on the terminal. The panoramic auxiliary lens 121can reflect or refract a surrounding view of the terminal, where thesurrounding view may be a 360-degree annular view centered on theterminal. The panoramic auxiliary lens 121 is in such a positionrelationship with the camera 122 that the panoramic auxiliary lens 121can reflect or refract the surrounding view of the terminal to aphotographing area of the camera 122. The method may include thefollowing steps:

Step 111: Receive the view reflected or refracted by the panoramicauxiliary lens.

Depending on default settings, the terminal may enable a panoramicphotographing function automatically when the user starts thephotographing application. In this case, the panoramic auxiliary lensreflects or refracts the surrounding view to the camera, where thepanoramic auxiliary lens is an annular reflection lens or refractionlens that reflects or refracts an annular view in a 360-degree scope tothe camera.

Alternatively, when the user starts the photographing application, theterminal may display a variety of option information to the user, forexample, information about a foreground mode, a background mode, a360-degree full-frame mode, and the like. The foreground mode refers toactivating only front view capturing on the terminal, where the defaultscale is 3:2, and user-defined adjustment may be performed according touser requirements in scenarios such as self-timer and video calls. Thebackground mode refers to activating only rear view capturing on theterminal, where the default scale is 3:2 and user-defined adjustment maybe performed according to user requirements in scenarios such asordinary photographing and video recording of users. The 360-degreefull-frame mode refers to activating 360-degree view finding andcapturing, and using a panoramic auxiliary lens and a single camera toobtain a 360-degree panoramic image. According to the user's operationof selecting the 360-degree full-frame mode, the terminal receives anannular view reflected by the panoramic auxiliary lens.

Step 112: Use the camera to photograph the view reflected or refractedby the panoramic auxiliary lens to obtain an image.

The camera photographs the annular view reflected or refracted by thepanoramic auxiliary lens to obtain a panoramic image, which mayspecifically be a 360-degree panoramic image centered on the terminal.

Step 113: Display the image obtained by photographing.

The panoramic image may be displayed in multiple display manners, forexample:

Manner 1: As shown in FIG. 13A, the obtained panoramic image may bedisplayed continuously in a planar expansion manner, or, as shown inFIG. 13B, the obtained panoramic image is displayed continuously in anannular manner, and the user can slide on the touch screen to browse thepanoramic image continuously.

Manner 2: The panoramic image may be divided into multiple images fromdifferent angles, and displayed in different positions on the displayscreen simultaneously. For example, as shown in FIG. 14, the image abouta view in front of the terminal is displayed on the left side in themiddle of the screen, and is the same as the image photographed by atraditional front camera of the terminal; the image about a view behindthe terminal is displayed on the right side in the middle of the screen,and is the same as the image photographed by a traditional rear cameraof the terminal; the image about a view in the 180-degree scope in frontof the terminal is displayed on the top of the screen; and the imageabout a view in the 180-degree scope behind the terminal is displayed atthe bottom of the screen. Nevertheless, other multiple images fromdifferent angles may be displayed.

In another embodiment of the present invention, before displaying theimage obtained by photographing, the method may further include: if theimage obtained by using camera to photograph the annular view reflectedor refracted by the panoramic auxiliary lens is a non-planar image,processing the non-planar image into a planar image.

As shown in FIG. 15, if the panoramic auxiliary lens 151 is a curvedreflector, the view reflected by the reflector is also a curved view,and the image obtained by photographing is also a distorted curved image152. In this step, by using an existing algorithm, the curved image 152can be processed into a planar image 153, and then the planar image 153is displayed.

In another embodiment of the present invention, as shown in FIG. 16, theprocess of using a camera to photograph an annular view reflected orrefracted by a panoramic auxiliary lens to obtain an image may includethe following steps:

Step 161: Obtain a focusing parameter of the camera.

The focusing parameter may be a focusing parameter obtained by thecamera in a default automatic focusing manner; or may be a focusingparameter input by the user manually and obtained by the terminal afterthe user inputs the parameter manually or adjusts a focus manually.

The obtaining, by the terminal, a focusing parameter input by the usermanually may include: first, using the camera to obtain a preview imageof the view reflected or refracted by the panoramic auxiliary lens,where the preview image includes multiple preview sub-images fromdifferent angles, where the multiple preview sub-images in the previewimage may be distributed in a manner shown in FIG. 14; and thendetermining a focusing parameter of the camera according to the user'soperation of adjusting a focus for any preview sub-image of the multiplepreview sub-images.

In the preview image displayed in the manner shown in FIG. 14, the usermay adjust the focus for a preview image from one angle manually todetermine the focusing parameter of the camera. According to the user'soperation of adjusting the focus for the preview image from one angle,the terminal may update the preview images from other angles in realtime after the focus is adjusted.

No matter in which manner to obtain the focusing parameter, at the timeof determining the focusing parameter, the preference order of afocusing target based on which the focusing parameter is determined maybe: in the display manner shown in FIG. 14, the preview image of therear view (on the right side in the middle of FIG. 14) is a firstchoice, the preview image of the front view (on the left side in themiddle of FIG. 14) is a second choice, the preview image of the180-degree rear view (on the top of FIG. 14) is a third choice, and thepreview image of the 180-degree front view (at the bottom of FIG. 14) isa last choice.

Step 162: According to the focusing parameter, use the camera tophotograph the annular view reflected or refracted by the panoramicauxiliary lens to obtain an image.

In another embodiment of the present invention, after the image obtainedby photographing is displayed, as shown in FIG. 17A, the imageprocessing method may further include:

Step 171: Crop the image obtained by photographing according to a presetscale.

Specifically, the 360-degree view may be cropped according to any scale(for example, a scale determined by the user by dragging a cutting box)or a template scale (for example, 3:2 as landscape to portrait, 4:3 aslandscape to portrait, 16:9 as landscape to portrait, 1:1, and thelike). As shown in FIG. 17B, the cropped view can be flattenedautomatically according to an algorithm and then saved.

Step 172: Save the cropped image.

Nevertheless, the 360-degree view may also be saved directly withoutcropping.

The embodiment of the present invention is applicable to a digitalcamera, a digital video camera, or even a professional camera, in orderto implement capturing of more information, and may be applied inscenarios such as television, movies, or even the game field, forexample, interactive programs and interactive movies may be recorded andlaunched. The user can rotate to watch other different corners duringwatching, and can wear a device on the head to implement realfour-dimensional (4D) experience. In the business field, the embodimentof the present invention may be integrated into a telepresenceconference system. In a scenario such as demonstration or conference, afull-frame conference that surpasses the current telepresence system canbe implemented.

The above description deals with method embodiments of the presentinvention, and the following introduces an apparatus for implementingthe method.

Referring to FIG. 18, FIG. 18 is a schematic structural diagram of animage processing apparatus according to an embodiment of the presentinvention.

The apparatus may include: an information receiving unit 181 configuredto receive information of starting a first camera and a second camerasimultaneously to perform photographing; an image obtaining unit 182configured to use the first camera to photograph and obtain a firstimage, and use the second camera to photograph and obtain a secondimage; and an image outputting unit 183 configured to display the firstimage and the second image simultaneously.

In the embodiment of the present invention, the foregoing unit in theapparatus starts two cameras simultaneously to perform bidirectionalphotographing, and simultaneously displays the images taken by bothcameras, so that front and back scene images are captured simultaneouslyand a panoramic image is obtained.

In another embodiment, as shown in FIG. 19, the image obtaining unit mayfurther include: a parameter obtaining subunit 191 configured to obtaina first focusing parameter of the first camera and a second focusingparameter of the second camera; and an image obtaining subunit 192configured to use the first camera to photograph according to the firstfocusing parameter to obtain the first image, and use the second camerato photograph according to the second focusing parameter to obtain thesecond image. In another embodiment, the parameter obtaining subunit 191may further include: a first subunit configured to use the first camerato obtain a preview image of the first image; and a second subunitconfigured to determine the first focusing parameter of the first cameraaccording to an operation of adjusting the focus for the preview imageof the first image.

In another embodiment of the present invention, as shown in FIG. 20, theimage inputting unit may further include: an area determining subunit2001 configured to determine a specified display area of the secondimage in the first image; and an outputting subunit 2002 configured todisplay the second image in the specified display area of the firstimage.

The area determining subunit 2001 may further include: a third subunitconfigured to determine a prominent area and a non-prominent area in thefirst image according to a preset algorithm; and a fourth subunitconfigured to use the non-prominent area in the first image as thespecified display area of the second image in the first image.

In another embodiment of the present invention, the image processingapparatus may further include: a locus obtaining unit configured toobtain a drag locus of the second image; and a position determining unitconfigured to determine a display position of the second image accordingto the drag locus.

In another embodiment of the present invention, the image processingapparatus may further include: an information obtaining unit configuredto obtain information about switching operations on display areas of thefirst image and the second image; and a switching unit configured toexchange the display areas of the first image and the second imageaccording to the information about the switching operation.

In another embodiment of the present invention, the image processingapparatus may further include: a calculating unit configured to obtainsimilarity between an edge area of the second image and a position thataccommodates the second image in the first image; a synthesizing unitconfigured to synthesize the second image with the first image if thesimilarity is greater than or equal to a threshold; and an adjustingunit configured to adjust the first image and/or the second image toincrease the similarity if the similarity is smaller than the threshold.

FIG. 21 is a schematic structural diagram of another image processingapparatus according to an embodiment of the present invention.

The apparatus is applied to a terminal that has a panoramic auxiliarylens and at least one camera, where the panoramic auxiliary lens is usedto reflect or refract a surrounding view of the terminal to aphotographing area of the camera, and the apparatus includes: a viewreceiving unit 211 configured to receive the view reflected or refractedby the panoramic auxiliary lens; an image obtaining unit 212 configuredto use the camera to photograph the view reflected or refracted by thepanoramic auxiliary lens to obtain an image; and an image outputtingunit 213 configured to display the image obtained by photographing.

The image outputting unit 213 may be specifically configured to: displaythe image obtained by photographing continuously in a planar expansionmanner; or display the image obtained by photographing continuously inan annular display manner; or divide the image obtained by photographinginto multiple images from different angles, and display the multipleimages from different angles simultaneously.

In the embodiment of the present invention, the apparatus can use theunits to capture front and back scene images simultaneously and obtain apanoramic image.

In another embodiment of the present invention, the image obtaining unitmay further include: a preview subunit configured to use the camera toobtain a preview image of the view reflected or refracted by thepanoramic auxiliary lens, where the preview image includes multiplepreview sub-images from different angles; a parameter determiningsubunit configured to determine a focusing parameter of the cameraaccording to an operation of adjusting the focus for any previewsub-image of the multiple preview sub-images; and an obtaining subunitconfigured to: according to the focusing parameter, use the camera tophotograph the view reflected or refracted by the panoramic auxiliarylens to obtain an image.

In another embodiment of the present invention, the apparatus mayfurther include: a cropping unit configured to crop the image obtainedby photographing according to a set scale; and a saving unit configuredto save the cropped image.

Referring to FIG. 22, FIG. 22 is a schematic structural diagram of aterminal according to an embodiment of the present invention.

The terminal may include a processor 221, a display 222, a memory 223, afirst camera 224, and a second camera 225, where the processor 221 isconfigured to control working states of the first camera 224 and thesecond camera 225, the processor 221 is connected to the display 222 andthe memory 223 respectively, the memory 223 stores a set of programcodes, and the processor 221 is configured to call the program codesstored in the memory to execute the following operations: receivinginformation of starting the first camera 224 and the second camera 225simultaneously to perform photographing; using the first camera 224 tophotograph and obtain a first image, and using the second camera 225 tophotograph and obtain a second image; and the display 222 is configuredto display the first image and the second image simultaneously.

In the embodiment of the present invention, the terminal starts twocameras simultaneously to perform bidirectional photographing, andsimultaneously displays the images taken by both cameras, so that frontand back scene images are captured simultaneously and a panoramic imageis obtained.

FIG. 23 is a schematic structural diagram of another terminal accordingto an embodiment of the present invention.

The terminal may include a processor 231, a display 232, a memory 233, apanoramic auxiliary lens 234, and at least one camera 235, where theprocessor 231 is configured to control a working state of the camera235, the panoramic auxiliary lens 234 is configured to reflect orrefract a surrounding view of the terminal to a photographing area ofthe camera 235, the processor 231 is connected to the display 232 andthe memory 233 respectively, the memory 233 stores a set of programcodes, and the processor 231 is configured to call the program codesstored in the memory 233 to execute the following operations: receivingthe view reflected or refracted by the panoramic auxiliary lens 234;using the camera 235 to photograph the view reflected or refracted bythe panoramic auxiliary lens 233 to obtain an image; and the display 232is configured to display the image obtained by photographing.

In the embodiment of the present invention, the terminal uses apanoramic auxiliary lens and a single camera to capture front and backscene images simultaneously and obtain a panoramic image.

In another embodiment of the present invention, as shown in FIG. 24, thepanoramic auxiliary lens 241 may be located on top of the terminal andconnected resiliently to the top of the terminal, and, while working,the panoramic auxiliary lens 241 are in an pop-up state to reflect orrefract a surrounding view of the terminal to a photographing area ofthe camera 242. The panoramic auxiliary lens 241 may specifically be anannular convex lens 243 or a fisheye lens 244. The fisheye lens is alens with a very short focal length (such as 16 mm or a shorter focallength) and an angle close to or equal to 180°, and is an extremewide-angle lens.

A person of ordinary skill in the art may be aware that, in combinationwith the examples described in the embodiments disclosed in thisspecification, units and algorithm steps may be implemented byelectronic hardware, or a combination of computer software andelectronic hardware. Whether the functions are performed by hardware orsoftware depends on the particular applications and design constraintconditions of the technical solution. A person skilled in the art mayuse different methods to implement the described functions for eachparticular application, but it should not be considered that theimplementation goes beyond the scope of the present invention.

It may be clearly understood by a person skilled in the art that, forthe purpose of convenient and brief description, for a detailed workingprocess of the foregoing system, apparatus, and unit, reference may bemade to a corresponding process in the foregoing method embodiments, anddetails are not described herein again.

In the several embodiments provided in the present application, itshould be understood that the disclosed system, apparatus, and methodmay be implemented in other manners. For example, the describedapparatus embodiment is merely exemplary. For example, the unit divisionis merely logical function division and may be other division in actualimplementation. For example, a plurality of units or components may becombined or integrated into another system, or some features may beignored or not performed. In addition, the displayed or discussed mutualcouplings or direct couplings or communication connections may beimplemented through some interfaces. The indirect couplings orcommunication connections between the apparatuses or units may beimplemented in electronic, mechanical, or other forms.

The units described as separate parts may or may not be physicallyseparate, and the parts displayed as units may or may not be physicalunits, may be located in one position, or may be distributed on aplurality of network units. Some or all of the units may be selected toachieve the objective of the solution of the embodiment according toactual needs.

In addition, functional units in the embodiments of the presentinvention may be integrated into one processing unit, or each of theunits may exist alone physically, or two or more units may be integratedinto one unit.

When the functions are implemented in a form of a software functionalunit and sold or used as an independent product, the functions may bestored in a computer-readable storage medium. Based on such anunderstanding, the technical solutions of the present inventionessentially, or the part contributing to the prior art, or all or a partof the technical solutions may be implemented in the form of a softwareproduct. The computer software product is stored in a storage medium andincludes several instructions for instructing a computer device (whichmay be a personal computer, a server, or a network device) or aprocessor to perform all or a part of the steps of the methods describedin the embodiments of the present invention. The foregoing storagemedium includes any mediums that can store program codes, such as auniversal serial bus (USB) flash drive, a removable hard disk, aread-only memory (ROM), a random access memory (RAM), a magnetic disk,or an optical disc.

The foregoing descriptions are merely specific embodiments of thepresent invention, but are not intended to limit the protection scope ofthe present invention. Any variation or replacement readily figured outby a person skilled in the art within the technical scope disclosed inthe present invention shall fall within the protection scope of thepresent invention. Therefore, the protection scope of the presentinvention shall be subject to the protection scope of the claims.

1. An image processing method, comprising: receiving information ofstarting a first camera and a second camera simultaneously to performphotographing; using the first camera to photograph and obtain a firstimage; using the second camera to photograph and obtain a second image;and displaying the first image and the second image simultaneously. 2.The method according to claim 1, wherein using the first camera tophotograph and obtain the first image comprises: obtaining a firstfocusing parameter of the first camera; and using the first camera tophotograph according to the first focusing parameter to obtain the firstimage.
 3. The method according to claim 2, wherein obtaining the firstfocusing parameter of the first camera comprises: using the first camerato obtain a preview image of the first image; and determining the firstfocusing parameter of the first camera according to an operation ofadjusting a focus for the preview image of the first image.
 4. Themethod according to claim 1, wherein displaying the first image and thesecond image simultaneously comprises: determining a specified displayarea of the second image in the first image; and displaying the secondimage in the specified display area of the first image.
 5. The methodaccording to claim 4, wherein determining the specified display area ofthe second image in the first image comprises: determining a prominentarea and a non-prominent area in the first image according to a presetalgorithm; and using the non-prominent area in the first image as thespecified display area of the second image in the first image.
 6. Themethod according to claim 4, wherein after displaying the first imageand the second image simultaneously, the method further comprises:obtaining a drag locus of the second image; and determining a displayposition of the second image according to the drag locus.
 7. The methodaccording to claim 4, wherein after displaying the first image and thesecond image simultaneously, the method further comprises: obtaininginformation about switching operations on display areas of the firstimage and the second image; and exchanging the display areas of thefirst image and the second image according to the information about theswitching operations.
 8. The method according to claim 4, wherein afterdisplaying the first image and the second image simultaneously, themethod further comprises: obtaining similarity between an edge area ofthe second image and a position that accommodates the second image inthe first image; and synthesizing the second image with the first imagewhen the similarity is greater than or equal to a threshold.
 9. Themethod according to claim 8, further comprising adjusting the firstimage and/or the second image to increase the similarity when thesimilarity is smaller than the threshold. 10.-13. (canceled)
 14. Animage processing apparatus, comprising: an information receiving unitconfigured to receive information of starting a first camera and asecond camera simultaneously to perform photographing; an imageobtaining unit configured to use the first camera to photograph andobtain a first image, and use the second camera to photograph and obtaina second image; and an image outputting unit configured to display thefirst image and the second image simultaneously.
 15. The apparatusaccording to claim 14, wherein the image obtaining unit comprises: aparameter obtaining subunit configured to obtain a first focusingparameter of the first camera and a second focusing parameter of thesecond camera; and an image obtaining subunit configured to use thefirst camera to photograph according to the first focusing parameter toobtain the first image, and use the second camera to photographaccording to the second focusing parameter to obtain the second image.16. The apparatus according to claim 15, wherein the parameter obtainingsubunit comprises: a first subunit configured to use the first camera toobtain a preview image of the first image; and a second subunitconfigured to determine the first focusing parameter of the first cameraaccording to an operation of adjusting a focus for the preview image ofthe first image.
 17. The apparatus according to claim 14, wherein theimage outputting unit comprises: an area determining subunit configuredto determine a specified display area of the second image in the firstimage; and an outputting subunit configured to display the second imagein the specified display area of the first image.
 18. The apparatusaccording to claim 17, wherein the area determining subunit comprises: athird subunit configured to determine a prominent area and anon-prominent area in the first image according to a preset algorithm;and a fourth subunit configured to use the non-prominent area in thefirst image as the specified display area of the second image in thefirst image.
 19. The apparatus according to claim 17, furthercomprising: a locus obtaining unit configured to obtain a drag locus ofthe second image; and a position determining unit configured todetermine a display position of the second image according to the draglocus.
 20. The apparatus according to claim 17, further comprising: aninformation obtaining unit configured to obtain information aboutswitching operations on display areas of the first image and the secondimage; and a switching unit configured to exchange the display areas ofthe first image and the second image according to the information aboutthe switching operations.
 21. The apparatus according to claim 17,further comprising: a calculating unit configured to obtain similaritybetween an edge area of the second image and a position thataccommodates the second image in the first image; a synthesizing unitconfigured to synthesize the second image with the first image when thesimilarity is greater than or equal to a threshold; and an adjustingunit configured to adjust the first image and/or the second image toincrease the similarity when the similarity is smaller than thethreshold. 22.-27. (canceled)
 28. A non-transitory computer-readablemedium having computer usable instructions stored thereon for executionby a processor, wherein the instructions cause the processor to: receiveinformation of starting a first camera and a second camerasimultaneously to perform photographing; use the first camera tophotograph and obtain a first image; use the second camera to photographand obtain a second image; and display the first image and the secondimage simultaneously.
 29. The non-transitory computer-readable mediumaccording to claim 28, wherein the instructions cause the processor touse the first camera to photograph and obtain the first image comprisesthe instructions causing the processor to: obtain a first focusingparameter of the first camera; and use the first camera to photographaccording to the first focusing parameter to obtain the first image. 30.The non-transitory computer-readable medium according to claim 29,wherein the instructions cause the processor to obtain the firstfocusing parameter of the first camera comprises the instructionscausing the processor to: use the first camera to obtain a preview imageof the first image; and determine the first focusing parameter of thefirst camera according to an operation of adjusting a focus for thepreview image of the first image.
 31. The non-transitorycomputer-readable medium according to claim 28, wherein the instructionscause the processor to display the first image and the second imagesimultaneously comprises the instructions causing the processor to:determine a specified display area of the second image in the firstimage; and display the second image in the specified display area of thefirst image.
 32. The non-transitory computer-readable medium accordingto claim 31, wherein the instructions cause the processor to determinethe specified display area of the second image in the first imagecomprises the instructions causing the processor to: determine aprominent area and a non-prominent area in the first image according toa preset algorithm; and use the non-prominent area in the first image asthe specified display area of the second image in the first image. 33.The non-transitory computer-readable medium according to claim 31,wherein after the instructions cause the processor to display the firstimage and the second image simultaneously, the instructions furthercause the processor to: obtain a drag locus of the second image; anddetermine a display position of the second image according to the draglocus.
 34. The non-transitory computer-readable medium according toclaim 31, wherein after the instructions cause the processor to displaythe first image and the second image simultaneously, the instructionsfurther cause the processor to: obtain information about switchingoperations on display areas of the first image and the second image; andexchange the display areas of the first image and the second imageaccording to the information about the switching operations.
 35. Thenon-transitory computer-readable medium according to claim 31, whereinafter the instructions cause the processor to display the first imageand the second image simultaneously, the instructions further cause theprocessor to: obtain similarity between an edge area of the second imageand a position that accommodates the second image in the first image;and synthesize the second image with the first image when the similarityis greater than or equal to a threshold.
 36. The non-transitorycomputer-readable medium according to claim 35, wherein the instructionsfurther cause the processor to adjust the first image and/or the secondimage to increase the similarity when the similarity is smaller than thethreshold.